
public class Animation
{

  public OBJModel model [];
  public int currentFrame = 0;
  public int frames = 0;
  public String directory = "";
 // public Action action = Action.Repeat;
  public PApplet parent;
  public float scale = 8;

  public OBJModel getFrame()
  {
    return model[currentFrame];
  }

  public Animation(PApplet parent, String directory)
  {
    this.parent = parent;
    this.directory = directory;
    String path = sketchPath + "/" + directory;
    String[] filenames = new File(path).list();

    if (filenames == null)
      println("ERROR");
    else
    {
      frames = filenames.length;
      model = new OBJModel[frames];
      // making an object called "model" that is a new instance of OBJModel
      for (int x = 0; x < frames;x++)
      {
        model[x] = new OBJModel(parent, "s/exp_"+x+".obj", "relative", POLYGON);
        model[x].scale(scale);
      }
    }
  }

  public void Draw()
  {

    //if (currentFrame>=frames)
      //currentFrame = 0;
    //if (currentFrame<frames)
      //model[currentFrame++].draw();
    //else
    noStroke();
    fill(255);
    model[0].draw();
        
    //noFill();
    //stroke(155);
    //new BoundingBox(parent,model[0]).draw();
    //noStroke();
    //fill(255);
  }
}

